/*
 * Created by SharpDevelop.
 * User: nebulom
 * Date: 9/2/2009
 * Time: 7:48 AM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Drawing;
using System.Windows.Forms;
using Buaya.Model;

namespace Buaya.Gui
{
	/// <summary>
	/// Description of ShipToInformationForm.
	/// </summary>
	public partial class ShipToInformationForm : BaseForm
	{
		public ShipToInformationForm(Company c)
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			Model = c;
		}
		
		protected override void OnModelChanged(EventArgs e)
		{
			base.OnModelChanged(e);
			Company c = Model as Company;
			textBoxName.Text = c.ShipToName;
			richTextBoxAddress.Text = c.ShipToAddress;
		}
		
		void ButtonOkClick(object sender, EventArgs e)
		{
			Company c = Model as Company;
			c.ShipToName = textBoxName.Text;
			c.ShipToAddress = richTextBoxAddress.Text;
			Close();
		}
		
		void ButtonCancelClick(object sender, EventArgs e)
		{
			Close();
		}
	}
}
